]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
unlockDialog: Honor switch user lockdown settings
authorRay Strode <rstrode@redhat.com>
Thu, 6 May 2021 13:32:48 +0000 (09:32 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 22 Jul 2021 20:17:29 +0000 (16:17 -0400)
At the moment user switching functionality is controlled by two
settings:

org.gnome.desktop.lockdown disable-user-switching

for the panel when the session is unlocked, and

org.gnome.desktop.screensaver user-switch-enabled

for the unlock dialog when the session is locked.

Having the lockdown setting not apply when the screen is
locked is counterintuitive.

This commit makes the unlock dialog honor both settings.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1833>

js/ui/unlockDialog.js

index 239e75ef5b283c77c531eb13c49645d1aafe410e..370385abc47bb9216efade9c71312e44c8891e10 100644 (file)
@@ -577,6 +577,10 @@ var UnlockDialog = GObject.registerClass({
         this._userSwitchEnabledId = this._screenSaverSettings.connect('changed::user-switch-enabled',
             this._updateUserSwitchVisibility.bind(this));
 
+        this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' });
+        this._lockdownSettings.connect('changed::disable-user-switching',
+            this._updateUserSwitchVisibility.bind(this));
+
         this._userLoadedId = this._user.connect('notify::is-loaded',
             this._updateUserSwitchVisibility.bind(this));
 
@@ -858,7 +862,8 @@ var UnlockDialog = GObject.registerClass({
 
     _updateUserSwitchVisibility() {
         this._otherUserButton.visible = this._userManager.can_switch() &&
-            this._screenSaverSettings.get_boolean('user-switch-enabled');
+            this._screenSaverSettings.get_boolean('user-switch-enabled') &&
+            !this._lockdownSettings.get_boolean('disable-user-switching');
     }
 
     cancel() {